#
# lib Makefile
#

CFLAGS = -Wall  -I../include/hci_inc -I./ -I../include/com_inc
ARFLAGS_SO += -shared -fPIC -o
REL_LIB = /home/zwht/m400/test_uav_det/Ver2/detr/lib

# export CROSS:=arm-gcc6.3-linux-uclibceabi-
export CROSS:=aarch64-v01c01-linux-gnu-
CC	= @echo "hisi GCC	$@"; $(CROSS)gcc
AR	= @echo "hisi AR	$@"; $(CROSS)ar
TP  = @echo "hisi TP	$@"; $(CROSS)strip


SRC  := $(wildcard *.c *.cpp)
OBJ  := $(SRC:%.c=%.o)

TARGET = libusrplatform.so


all: $(TARGET)

%.o: %.c
	$(CC) $(CFLAGS) -fPIC -c $< -o $@

.PHONY: clean

$(TARGET): %: $(OBJ) 
	$(CC) $(CFLAGS) $(ARFLAGS_SO) $@ $^ -lpthread 
	@cp $(TARGET) $(REL_LIB)

clean:
	rm -f *.o *.so
